<?php

namespace App\Http\Controllers;

use App\Models\Expert;
use App\Models\Video;
use Illuminate\Http\Request;

class ExpertController extends Controller
{
    public function index()
    {
        $ovideo=Video::where('leixing','0')->orderby('updated_at','desc')->take(3)->get();

        return view("front.index")->with('ovideo',$ovideo);
    }
    public function create()
    {
        return view('admin.expert-create');

    }
    public function store(Request $request)
    {

    }
    public function edit($id)
    {
        return view('admin.expert-edit');
    }
    public  function update($id,Request $request)
    {

    }
    public function destroy($id)
    {

    }
    public function ExpertList(){
        return view('admin.expert');
    }

    public function expert(){
        $expert=expert::orderby('created_at','desc')->paginate(5);
        return view('front.expert')->with('expert',$expert);
    }
    public function expertinfo($id){
        $expert=expert::find($id);
        $Oexpert=expert::where('id','!=',$id)->take(3)->get();
        return view('front.expert-info')->with('expert',$expert)->with('Oexpert',$Oexpert);
    }
}
